/**
 * Created by gongxun on 17/1/13.
 */

var PszCard = cc.Sprite.extend({
    mCardNum : null,
    mSeat : null,
    ctor : function(){
        this._super();
        this.setAnchorPoint(cc.p(0.5, 0.5));

        this.mCardNum = 0;
    },

    setCardNum : function(num){
        if (mo.pszCardHelper.getExistCardNum(num)){
            this.mCardNum = num;
        }else{
            this.mCardNum = 0;
        }
    },

    //kind 1:正常 2:破损
    setCardKind : function(seat, kind){
        this.mSeat = seat;

        if (kind == 1){
            if (this.mCardNum == 0){
                this.setSpriteFrame("psz_bg1.png");
            }else{
                this.setSpriteFrame("psz_" + this.mCardNum + ".png");
            }
        }else if (kind == 2){
            if (this.mCardNum == 0){
                this.setSpriteFrame("psz_bg2.png");
            }else{
                this.setSpriteFrame("psz_" + this.mCardNum + ".png");
            }
        }
    },
    //返回牌花色 0:tao 1:xin 2:mei 3:fang
    getCardSuit : function(num){
        var temp = num - 1;
        return parseInt(temp / 13);
    }
});